<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<link href="<?php echo $this->baseUrl;?>/admincss/style.css" rel="stylesheet" type="text/css" />
<link href="<?php echo $this->baseUrl;?>/admincss/thickbox.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript">
var baseUrl = "<?php echo $this->baseUrl;?>";
function doCheck(obj)
{
	var type = obj.id.split('_')[0];
	var aid = obj.id.split('_')[1];
	$('#myOnPageContent_div').html("发送请求中...");
	tb_show("", "#TB_inline?height=100&width=300&inlineId=myOnPageContent&r="+Math.random());	
	$.post("./?m=admin&c=article&a=check", {type:type, aid:aid, checked:obj.checked}, function (data){
		$('#myOnPageContent_div').html(data);
		if (type == 'check2' && obj.checked){
			$('#check1_'+aid).attr('checked', 1);
		}
		setTimeout(function (){tb_remove();}, 300);
	});
}
</script>

<script language="javascript" type="text/javascript" src="<?php echo $this->baseUrl;?>/adminjs/jquery.pack.js" /></script>
<script language="javascript" type="text/javascript" src="<?php echo $this->baseUrl;?>/adminjs/thickbox.compressed.js" /></script>
<body>
<table width="100%" border="1" class="tableA">
  <tr>
    <td width="5%" nowrap>编号</td>
    <td>分类</td>
    <td>发布人</td>
    <td>标题</td>
    <td>作者</td>
    <td>发布时间</td>
    <td>排序</td>
    <td>操作</td>
  </tr><!--
<?php
foreach ($this->list as $v){
$type = $this->types[$v['cid']];
$editurl = $this->url($this->fullUrl, 'article', 'edit','aid='.$v['aid'] . '&nowp=' . $this->nowp . '&type=' . $this->type);
$delurl=$this->url($this->fullUrl, 'article', 'del', 'aid='.$v['aid'] . '&nowp=' . $this->nowp . '&type=' . $this->type);
$title = addslashes(htmlspecialchars($v['title']));
$editpri = '';

if ($this->type == 'center0'){//信息员管理 只能查看自己的文章
	$disable1 = ' disabled=true ';
	$disable2 = ' disabled=true ';
	if ( ($v['check1'] || $v['check2']) && $v['iscenter'])
		$editpri = 'disabled=true onclick="javascript:return false;"';
}elseif ($this->type == 'center1'){// 1级审核
	$disable1 = ' ';
	$disable2 = ' disabled=true ';
	if ($v['check2'])
		$editpri = 'disabled=true onclick="javascript:return false;"';
}elseif ($this->type == 'center2'){// 2级审核
	$disable1 = ' ';
	$disable2 = ' ';
}

if ($this->type == 'study'){
	$check1 = '';
	$check2 = '';
}else{
	$ischeck1 = $v['check1'] == 1?' checked=true ':' ';
	$ischeck2 = $v['check2'] == 1?' checked=true ':' ';
	
	$check1 = '<input ' . $ischeck1 . $disable1. 'type="checkbox" id="check1_' . $v['aid'] . '" name="check1" value="1"  title="点击进行审核" onclick="javascript:return doCheck(this)"/><label for="check1_' . $v['aid'] . '">一级审核</label>';
	$check2 = '<input ' . $ischeck2 . $disable2.'type="checkbox" id="check2_' . $v['aid'] . '" name="check2" value="1"  title="点击进行审核"  onclick="javascript:return doCheck(this)"/><label for="check2_' . $v['aid'] .'">二级审核</label>';
}
print <<<EOT
-->
  <tr>
    <td nowrap>{$v['aid']}</td>
    <td nowrap>{$type}</td>
    <td nowrap>{$v['username']}</td>
    <td nowrap>{$v['title']}</td>
    <td nowrap>{$v['author']}</td>
    <td nowrap>{$v['pubtime']}</td>
    <td nowrap>{$v['seq']}</td>
    <td nowrap><a href="{$editurl}" {$editpri}>编辑</a> <a href="{$delurl}" onclick="return window.confirm('确认删除:{$title}');">删除</a>
    {$check1} {$check2}
    </td>
  </tr><!--
EOT;
}
$indexurl =$this->url($this->fullUrl, 'article', 'list', 'nowp=1' . '&type=' . $this->type);
$nexturl = $this->url($this->fullUrl, 'article', 'list', 'nowp='.$this->page['next']  . '&type=' . $this->type);
$preurl = $this->url($this->fullUrl, 'article', 'list', 'nowp='.$this->page['previous']  . '&type=' . $this->type);
$lasturl = $this->url($this->fullUrl, 'article', 'list', 'nowp='.$this->page['totalpage']  . '&type=' . $this->type);
print <<<EOT
-->
  <tr>
    <td colspan="8">共{$this->page['totalnum']}篇 {$this->page['nowp']}/{$this->page ['totalpage']}
<a href="{$indexurl}">首页</a>
<a href="{$nexturl}">下一页</a>
<a href="{$preurl}">前一页</a>
<a href="{$lasturl}">末页</a></td>
  </tr>
<!--
EOT;
?>-->
</table>
<div id="myOnPageContent" style="display:none">
<div align="center" id="myOnPageContent_div">操作成功</div>
</div>
</body>
</html>
